import facade
from xjlibrary.our_file_dir import BaseDir
from xjlibrary.tools.BaseUrl import BaseUrl

curPath = BaseDir.get_file_dir_absolute(__file__)
sql = "select provider_url from modify_title_info_zt"
sqlutils = facade.Sqlite3Utiles().Sqlite3DBConnectFromFilePath(r"C:\Users\xuzhu\Desktop\cnkistandard_2019-05-30_151.db3")
mysqlutils = facade.MysqlUtiles(BaseDir.get_new_path(curPath, "db.ini"), "db", facade.get_streamlogger())

rows = sqlutils.SelectFromSqlliteFetchall(sql)
for row in rows:
    providerurl = row[0]
    providerurl = providerurl.replace("cnkistandard@","")
    dicts = BaseUrl.urlQuery2Dict(providerurl)
    filename = dicts["filename"]
    sql = "update article set stat=0 where filename='{}'".format(filename)
    mysqlutils.ExeSqlToDB(sql)
